package com.lovo.system.controller;

import com.lovo.system.dto.PurchaseDetailsDto;
import com.lovo.system.service.IPurchaseDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/purchaseDetails")
public class PurchaseDetailsController {

    @Autowired
    IPurchaseDetailsService purchaseDetailsService;

    @RequestMapping("/info")
    public List<PurchaseDetailsDto> info(int fkId){
        return purchaseDetailsService.info(fkId);
    }

    @RequestMapping("/add")
    public void addPurchaseDetails(@RequestBody PurchaseDetailsDto purchaseDetailsDto){
        purchaseDetailsService.insertPurchaseDetails(purchaseDetailsDto);
    }


}
